package com.minimalist.common.entity.lindi.vo.index;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标平台_林地指标实体")
public class LindiIndexVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "指标ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "indexId", description = "指标ID", type = "string")
    private Long indexId;

    @Schema(name = "locationName", description = "镇街名称", type = "string")
    private String locationName;

    @Schema(name = "purchaseIndex", description = "购入指标", type = "string")
    private String purchaseIndex;

    @Schema(name = "tradeIndex", description = "交易指标", type = "string")
    private String tradeIndex;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    public LindiIndexVO(){
    }

    public Long getIndexId(){
        return indexId;
    }

    public void setIndexId(Long indexId){
        this.indexId = indexId;
    }

    public String getLocationName(){
        return locationName;
    }

    public void setLocationName(String locationName){
        this.locationName = locationName;
    }

    public String getPurchaseIndex(){
        return purchaseIndex;
    }

    public void setPurchaseIndex(String purchaseIndex){
        this.purchaseIndex = purchaseIndex;
    }

    public String getTradeIndex(){
        return tradeIndex;
    }

    public void setTradeIndex(String tradeIndex){
        this.tradeIndex = tradeIndex;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiIndexVO that = (LindiIndexVO) o;
        return Objects.equals(indexId, that.indexId) && Objects.equals(locationName, that.locationName) && Objects.equals(purchaseIndex, that.purchaseIndex) && Objects.equals(tradeIndex, that.tradeIndex) && Objects.equals(createId, that.createId) && Objects.equals(updateId, that.updateId) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode(){
        return Objects.hash(indexId, locationName, purchaseIndex, tradeIndex, createId, updateId, createTime, updateTime);
    }
}
